@ibiz-template-plugin/ai-chat 0.0.94 → 0.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -20998,8 +20998,9 @@ class Ec {
20998
20998
  * @date 2023-10-15 19:10:34
20999
20999
  * @param {IChatOptions} opts 聊天配置
21000
21000
  * @param {IChatOptions} resourceOptions 资源配置
21001
+ * @param {ITopicOptions} topicOptions 会话配置
21001
21002
  */
21002
- constructor(e, t) {
21003
+ constructor(e, t, i) {
21003
21004
  /**
21004
21005
  * 事件触发器
21005
21006
  * @type {EventBase}
@@ -21186,7 +21187,7 @@ class Ec {
21186
21187
  * @memberof AiChatController
21187
21188
  */
21188
21189
  _(this, "inited", X(!1));
21189
- this.opts = e, this.resourceOptions = t, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.aiTopic = e.aiTopic, this.topicId = e.topicId, this.topic = e.topic, this.enableAIAgentChange = !!e.enableAIAgentChange, this.chatMode = e.srfMode, this.chatScope = e.srfScope, this.chatSessionid = e.sessionid, this.enableKnowledgeBaseSelect.value = !!e.enableKnowledgeBaseSelect, this.enableKnowledgeBaseState.value = this.enableKnowledgeBaseSelect.value, this.enableRecallConfigSetting.value = !!e.enableRecallConfigSetting, this.initAIChat();
21190
+ this.opts = e, this.resourceOptions = t, this.topicOptions = i, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.aiTopic = e.aiTopic, this.topicId = e.topicId, this.topic = e.topic, this.enableAIAgentChange = !!e.enableAIAgentChange, this.chatMode = e.srfMode, this.chatScope = e.srfScope, this.chatSessionid = e.sessionid, this.enableKnowledgeBaseSelect.value = !!e.enableKnowledgeBaseSelect, this.enableKnowledgeBaseState.value = this.enableKnowledgeBaseSelect.value, this.enableRecallConfigSetting.value = !!e.enableRecallConfigSetting, this.initAIChat();
21190
21191
  }
21191
21192
  /**
21192
21193
  * AI资源模式
@@ -21215,7 +21216,7 @@ class Ec {
21215
21216
  if (e && e.captionMode)
21216
21217
  return e.captionMode;
21217
21218
  }
21218
- return "default";
21219
+ return this.topicOptions && this.topicOptions.captionMode ? this.topicOptions.captionMode : "default";
21219
21220
  }
21220
21221
  /**
21221
21222
  * 当前话题标题
@@ -21462,7 +21463,7 @@ class Ec {
21462
21463
  }
21463
21464
  }
21464
21465
  }
21465
- await this.markLastUserMessage();
21466
+ await this.markLastUserMessage(), this.opts.captionComputedMode && this.opts.captionComputedMode === "history" && await this.updateTopicCaption();
21466
21467
  }
21467
21468
  /**
21468
21469
  * 更新数据到indexdb
@@ -21716,7 +21717,7 @@ class Ec {
21716
21717
  this.getQueryRecallConfig(),
21717
21718
  this.opts.appendCurData,
21718
21719
  this.opts.srfMcpservers
21719
- ), await this.markLastUserMessage(), await this.updateTopicCaption(), this.opts.action && this.opts.action("question", e), this.isLoading.value = !1;
21720
+ ), await this.markLastUserMessage(), this.opts.captionComputedMode && (this.opts.captionComputedMode === "history" || this.opts.captionComputedMode === "question") && await this.updateTopicCaption(), this.opts.action && this.opts.action("question", e), this.isLoading.value = !1;
21720
21721
  } finally {
21721
21722
  this.isLoading.value = !1;
21722
21723
  }
@@ -23171,7 +23172,11 @@ class Tf {
23171
23172
  topic: r,
23172
23173
  aiTopic: this.aiTopic
23173
23174
  });
23174
- const s = new Ec(i, this.resourceOptions);
23175
+ const s = new Ec(
23176
+ i,
23177
+ this.resourceOptions,
23178
+ e.topicOptions
23179
+ );
23175
23180
  return this.aiTopicMap.set("".concat(r == null ? void 0 : r.id), s), e.mode && e.mode === "TOPIC" && this.aiTopic.isTempChat.value ? this.aiTopic.enterTempChat() : this.renderChatContent(e, i, s), s;
23176
23181
  }
23177
23182
  /**
@@ -23216,6 +23221,7 @@ class Tf {
23216
23221
  * @memberof ChatBaseController
23217
23222
  */
23218
23223
  switchAiChatController(e) {
23224
+ var r;
23219
23225
  const t = {
23220
23226
  ...this.backupChatOptions.chatOptions
23221
23227
  };
@@ -23245,7 +23251,11 @@ class Tf {
23245
23251
  openLinkView: this.backupChatOptions.chatOptions.openLinkView
23246
23252
  });
23247
23253
  let i;
23248
- this.aiTopicMap.has("".concat(e.id)) ? (i = this.aiTopicMap.get("".concat(e.id)), i.updateAIChat()) : (i = new Ec(t, this.resourceOptions), this.aiTopicMap.set("".concat(e.id), i)), this.renderSwitchedContent(t, i);
23254
+ this.aiTopicMap.has("".concat(e.id)) ? (i = this.aiTopicMap.get("".concat(e.id)), i.updateAIChat()) : (i = new Ec(
23255
+ t,
23256
+ this.resourceOptions,
23257
+ (r = this.backupChatOptions) == null ? void 0 : r.topicOptions
23258
+ ), this.aiTopicMap.set("".concat(e.id), i)), this.renderSwitchedContent(t, i);
23249
23259
  }
23250
23260
  /**
23251
23261
  * @description 关闭聊天窗口